Procesamiento de Señales e Imagenes

Ingeniería Biomédica

Ph.D. Pablo Eduardo Caicedo Rodríguez

2025-07-23

Procesamiento de imágenes

What is Digital Image Processing?

Definition

  • Two-dimensional function, f(x, y)
  • Where x and y are spatial coordinates.
  • The amplitude of f at any pair of coordinates (x, y) is called the intensity.

The digital image

If the coordinates and the intensity are discrete quantities the image turns into a digital image.

What is Digital Image Processing?

Definition

A digital image is composed by a finite number of elements called PIXEL.

https://www.researchgate.net/figure/Digital-image-representation-by-pixels-vii_fig2_311806469

Depth

A digital image is composed by a finite number of elements called PIXEL. Bpp( Bits per pixel)

  • 1bpp. B/W image, monochrome.
  • 2bpp. CGA Image.
  • 4bpp. Minimun for VGA standard.
  • 8bpp. Super-VGA image.
  • 24bpp. Truecolor image.
  • 48bpp. Professional-level images.

What is Digital Image Processing?

https://www.researchgate.net/figure/Digital-image-representation-by-pixels-vii_fig2_311806469

Color Space

How can i represent the color

  • RGB.
  • CMYK.
  • HSV.
  • Among others.

What is Digital Image Processing?

import cv2
import matplotlib.pyplot as plt

img = cv2.imread(image_path+"image01.tif")
fig001 = plt.figure()
plt.imshow(img)

import cv2
import matplotlib.pyplot as plt

img = cv2.imread(image_path+"lena.tif")
RGB_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
fig002 = plt.figure()
plt.imshow(RGB_img)

Images and vision

  • The paradigm surrounding the conceptualization of light and perception has undergone significant evolution.
  • Initially, the prevailing understanding within humanity posited that visual stimuli emanated from the eye itself.
  • However, contemporary knowledge has elucidated that light originates from external sources, undergoes reflection from objects within the environment, and is subsequently captured by the eye.

Images and vision

Important

We also understand that light is a type of electromagnetic radiation, and its wavelength falls within a range from 400 nanometers to 700 nanometers.

Taken from Corke 2023

Images and vision

Important

  • The most common way light is made is by something getting really hot. This makes energy that comes out as light.

  • Some important term are:

    • Absortion: It is the fraction of light which a body absorbs depending on the wavelength.
    • Reflectance: It is the fraction of the incoming light which a body reflects. It’s a number between 0 to 1 and also depends on wavelength.
    • Luminance: It is the fraction of the incoming light which a surface reflects. It’s a function of absortion and reflectance, and because of that luminance depends on wavelength.

Images and vision

The eye

  • Our eye has two types of cells. Cones and Rods.
  • Cones are the most sensitive cells but above all these are color sensitive.
  • Rods responds only two intensity and they used on night, mostly.
  • Humans, like most primates, are trichomats. This means that humans have three types of cones (Long, Medium and shorts).
    • 65% of longs (Sense red)
    • 33% of mediums (Sense green)
    • 2% of shortsv(Sense blue)

Images and vision

The artificial eye

Taken from Corke 2023

The currents from each sensor are function of the luminance and the spectral response filter.

Images and vision

Taken from https://web.stanford.edu/class/cs231a/course_notes/01-camera-models.pdf

Images and vision

Taken from https://web.stanford.edu/class/cs231a/course_notes/01-camera-models.pdf

Images and vision

Taken from https://web.stanford.edu/class/cs231a/course_notes/01-camera-models.pdf

Images and vision

Taken from https://web.stanford.edu/class/cs231a/course_notes/01-camera-models.pdf

Images and vision

Taken from https://web.stanford.edu/class/cs231a/course_notes/01-camera-models.pdf

Sampling and quantization

Definition

Sampling: Digitalization of the spatial coordinates.

Definition

Quantiazation: Digitalization of the light intensity (amplitude).

Sampling and quantization

Tomado de Gonzalez, Rafael C., y Richard E. Woods. 2018. Digital Image Processing. New York, NY: Pearson.

Sampling and quantization

Sampling and quantization

1bit

2bit

3bit

4bit

5bit

6bit

7bit

8bit

Sampling and quantization

Tomado de Gonzalez, Rafael C., y Richard E. Woods. 2018. Digital Image Processing. New York, NY: Pearson.

Linear indexing

Tomado de Gonzalez, Rafael C., y Richard E. Woods. 2018. Digital Image Processing. New York, NY: Pearson.

From normal to linear

\[\alpha = My+x\]

From linear to normal

\[x = \alpha \bmod M\]

\[y = \frac{\alpha - x}{M}\]

Spatial resolution

Tomado de Gonzalez, Rafael C., y Richard E. Woods. 2018. Digital Image Processing. New York, NY: Pearson.

Intensity resolution

Tomado de Gonzalez, Rafael C., y Richard E. Woods. 2018. Digital Image Processing. New York, NY: Pearson.

Intensity resolution

Tomado de Gonzalez, Rafael C., y Richard E. Woods. 2018. Digital Image Processing. New York, NY: Pearson.

“A simple problem”

Tomado de https://medium.com/@abhishekjainindore24/semantic-vs-instance-vs-panoptic-segmentation-b1f5023da39f

“A simple problem”

Tomado de https://medium.com/@abhishekjainindore24/semantic-vs-instance-vs-panoptic-segmentation-b1f5023da39f

Relationships between pixels

Neighborhood

N4

ND

N8
Figura 1

Relationships between pixels – Neighborhood

Neighborhood

N4-\(N_4\left(p\right)\)

ND-\(N_D\left(p\right)\)

N8-\(N_8\left(p\right)\)
Figura 2: Neighborhoods

Relationships between pixels – Adjacency

Rules for adjecency

  • 4-Adjecncy: Two pixels p and q with values from V are 4-adjacent if q is in the set \(N_4\left(p\right)\)

  • 8-adjacency. Two pixels p and q with values from V are 8-adjacent if q is in the set \(N_8\left(p\right)\)

  • m-adjacency (also called mixed adjacency). Two pixels p and q with values from V are m-adjacent if:

    • q is in \(N_4\left(p\right)\).
    • q is in \(N_D\left(p\right)\) and the set \(N_4\left(p\right) \cap N_4\left(q\right)\) has no pixels whose values are from V.

Relationships between pixels

Adjacency

Relationships between pixels

A4

A4

A8

A8

A-m

A-m

Relationships between pixels – Path

Digital path

It is a sequence of adjacent pixels.

\[\left(x_0, y_0\right), \left(x_1, y_1\right), \left(x_2, y_2\right), \dots \left(x_n, y_n\right)\]

If \(\left(x_0, y_0\right)=\left(x_n, y_n\right)\) the path is known as closed path

Let S represent a subset of pixels in an image. Two pixels p and q are said to be connected in S if there exists a path between them consisting entirely of pixels in S.

Relationships between pixels – Path, Connected Subset

Relationships between pixels – Regions

Relationships between pixels – Boundary

Relationships between pixels – Distance

Distance

  • City block distance: \(D_4\left(p,q\right) = \lvert x-u\rvert + \lvert y-v \rvert\)
  • Chessboard distance: \(D_8\left(p,q\right) = max \left(\lvert x-u\rvert , \lvert y-v \rvert \right)\)
  • Euclidean distance: \(D_e\left(p,q\right) = \sqrt{\left(x-u\right)^2 + \left(y-v\right)^2}\)

Relationships between pixels

Distance

  • City block distance: \(D_4\left(p,q\right) = \lvert x-u\rvert + \lvert y-v \rvert\)
  • Chessboard distance: \(D_8\left(p,q\right) = max \left(\lvert x-u\rvert , \lvert y-v \rvert \right)\)
  • Euclidean distance: \(D_e\left(p,q\right) = \sqrt{\left(x-u\right)^2 + \left(y-v\right)^2}\)